<template>
  <div class="decoration">
    <div>
      <img :src="`/img/${cases.imageUrl}`" alt="">
    </div>
    <div>
      <div>
        <span>{{ cases.title }}</span>
        <span><van-icon name="fire-o"/>{{ cases.pvCount }}人在看</span>
      </div>
      <h3>{{ cases.area }}㎡ | {{ cases.room }}室1厅1厨1卫 | {{ cases.region }} | {{ cases.brandName }}</h3>
      <div>
        <h2>用户评论</h2>
      <div class="comment" v-for="(item,i) in message" :key="i">
        <div>
        <img src="../assets/img/unlogin.png" alt="">
        <div class="img">
          <h1>{{item.name}}</h1>
          <van-tag type="warning">{{ item.style === 1 ? "老房" : "新房" }}</van-tag>
          <van-tag type="warning">{{ item.area }}㎡</van-tag>
          <van-tag type="warning">{{ item.value }}</van-tag>
          <van-rate void-color="#FFFFFFFF" v-model="item.score" readonly />
        </div>
        </div>
        <div>
           <div>{{item.content}}</div>
        </div>
      </div>
      </div>
      <div class="x-button">
        <router-link to="/compute">
          <span></span>
          计算报价
        </router-link>
        <button>电话咨询</button>
      </div>
    </div>

  </div>
</template>

<script>
import {mapState} from "vuex"
import {post,get} from "../assets/js/config/api";

export default {
  name: "Decoration_inf",
  computed: mapState(["shopId", "imageUrl"]),

  data() {
    return {
      cases: {},
      id: this.$route.params.id,
      projectOrderId: {},
      params:{},
      message:[],
      value:'',
    }
  },
  mounted() {
    this.projectOrderId.projectOrderId = this.id

    post('/cases', this.projectOrderId).then(

            result => {
              console.log(result);
              this.cases = result.result;}
        ).catch(err => {
      console.log(err)
    })
   this.params.orderId=this.id
    get('/comment',this.params).then(
        result=>{console.log(result)
        this.message=result.result
        }
    )


  },
  methods: {}
}
</script>

<style lang="scss">
@import "../../public/sass/decoration_inf";
</style>
